# 项目配置
from pathlib import Path
from database import tables
from database.sq_database import DataBase
from utils.autorun import AutoRunTask
from utils import autorun
import data_update

# 代理设置
# 
proxy_host = 'dynamic.xingsudaili.com'
proxy_port = 10010
proxy_username = 'wsw'
proxy_pwd = 'wsw200053'
proxyMeta = "http://%(user)s:%(pass)s@%(host)s:%(port)s" % {
    "host": proxy_host,
    "port": proxy_port,
    "user": proxy_username,
    "pass": proxy_pwd,
}
proxies = {
    'http': proxyMeta,
    'https': proxyMeta,
}


# 数据库配置
sqlite_database_root = Path('database')
sqlite_database_filename = sqlite_database_root / 'sqlite.db'
sqlite_tables = [tables]
database_not_warning = True

# 实例化数据库
DB = DataBase(sqlite_database_filename,
              table_modules=sqlite_tables, not_warning=database_not_warning)  # 数据库返回的实例

# 自动化任务
autorun.DebugMode = True
AutoTasks = [data_update]
AT = AutoRunTask(AutoTasks)
